<?php

namespace Yolo\Observers;

abstract class AbstractSubject implements SubjectInterface
{
    public function __construct(
        protected readonly ObserverManager $observerManager
    ){}

    /**
     * Notify observers.
     * @param array $data Data to notify observers with.
     * @return void
     */
    public function notify(array $data): void
    {
        $this->observerManager->notify(static::class, $data);
    }
}